//
//  WKStockHeaderview_Type_Two.m
//  XTXOneToOne
//
//  Created by Canny on 2018/11/21.
//  Copyright © 2018年 WK. All rights reserved.
//

#import "WKStockHeaderview_Type_Two.h"



@implementation WKStockHeaderview_Type_Two
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor=[UIColor whiteColor];
        [self createUI];
    }
    return self;
}
-(void)createUI{
    
    CGFloat W1 = G_SCREENWIDTH/3.0, W2 = G_SCREENWIDTH/3.0+100,W3 = G_SCREENWIDTH/3.0,Font = 12;
    UILabel * lab1 = [[UILabel alloc]init];
    [self setLab:lab1 withColor:RGB(40,40,40) andFont:Font andText:@"时间" andTextAlignment:NSTextAlignmentLeft];
    [self addSubview:lab1];
    [lab1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.top.equalTo(self);
        make.left.equalTo(self.mas_left).offset(10);
        make.width.equalTo(@(W1));
    }];
    
    UILabel * lab2 = [[UILabel alloc]init];
    [self setLab:lab2 withColor:RGB(40,40,40) andFont:Font andText:@"价格(USDT)" andTextAlignment:NSTextAlignmentCenter];
    [self addSubview:lab2];
    [lab2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.top.equalTo(self);
        make.centerX.equalTo(self.mas_centerX);
        make.width.equalTo(@(W2));
    }];
    
    UILabel * lab3 = [[UILabel alloc]init];
    [self setLab:lab3 withColor:RGB(40,40,40) andFont:Font andText:@"数量(BTC)" andTextAlignment:NSTextAlignmentRight];
    [self addSubview:lab3];
    [lab3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.top.equalTo(self);
        make.right.equalTo(self.mas_right);
        make.width.equalTo(@(W3));
    }];
 
    
}

-(void)setLab:(UILabel *)lab withColor:(UIColor *)color andFont:(CGFloat)font andText:(NSString *)text andTextAlignment:(NSTextAlignment)textAlignment{
    lab.text=text;
    lab.textColor=color;
    lab.font=[UIFont systemFontOfSize:font];
    lab.textAlignment=textAlignment;
}



/*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect {
 // Drawing code
 }
 */

@end

